package etc;


import javax.swing.JFrame;

import network.NetworkDebug;
import network.ServerConnection;
import gui.Gui;
import gui.Guimap;
import gui.GuimapListener;
import gui.Selection;

public class Main extends JFrame {
	
	public static void main(String[] args) {
		new Main();
	}
	
	public Main() {
		super("duper");
		Logger logg = new Logger();
		Selection s = new Selection();
		PlayerStats ps = new PlayerStats();
		ps.cash = 10000;
		ps.lives = 100;

		Guimap gmap = new Guimap();

		ServerConnection nl = new ServerConnection();

		GuimapListener gmm = new GuimapListener(gmap, s, ps, nl);
		gmap.addMouseListener(gmm);
		this.addKeyListener(gmm);

		new Gui(gmap, s, ps, logg);
		
		nl.addListener(logg);
		nl.addListener(ps);
		nl.addListener(gmap);
		nl.addListener(new NetworkDebug());
		new Thread(nl).start();
	}
	
}
